<!--  -->
<template>
    <div class='detail'>
        <h1>{{id}}</h1>
        <article>
            id：{{info.id}}
            <hr>
            姓名： {{info.name}}
            <hr>
            课程： {{info.lesson}}
        </article>
    </div>
</template>

<script>
/* eslint-disable */ // 忽略该行往下 eslint的错误
    //这里可以导入其他文件（比如：组件，工具js，第三方插件js，json文件，图片文件等等）

    export default {
        props: ['id'],
        //import引入的组件需要注入到对象中才能使用
        components: {},
        data() {
            return {
                info: {}
            };
        },
        computed: {},
        watch: {},
        methods: {},
        async created() {
            let detailInfo = await this.$post('http://localhost:8080/detail', {
                id: this.id
            })
            this.info = detailInfo
        },
        async delUserList(id) {
            let data = await this.$post('http://localhost:8080/del', {
                id
            })
            if (data) {
                this.getUserList()
            }
        },
        async editUserList() {
            let data = await this.$post('http://localhost:8080/edit', this.edit)
            if (data) {
                this.getUserList()
            }
        },
    }

</script>
<style scoped>
    h1 {
        text-align: center;
        padding: 10px;
    }

    article {
        padding: 10xp;
        max-width: 100%;
        overflow: hidden;
    }

    article img {
        max-width: 100%;
    }

</style>
